#include <cstdlib>
#include <cstdio>

extern FILE* yyin;
extern int yyleng;
extern char* yytext;
extern int yylex ();
extern int yyparse ();
int nombreDeCaractere;
int nombreDeLigne;
main ( int argc, char** argv )
{
	if ( argc != 2 )
	{
		fprintf ( stderr, "Usage: %s <nomdefichier>\n", argv [ 0 ] );
		exit ( -1 );
	}
	yyin = fopen ( argv [ 1 ], "r" );
	if ( yyin == NULL )
	{
		fprintf ( stderr, "Error: unable to open %s\n", argv [ 1 ] );
		exit ( -1 );
	}
	int res;
	res = yyparse ();
	//fprintf ( stdout, "Analyse [%d]\n", res );
	fprintf ( stdout, "Results: %d caracateres, %d lignes\n", nombreDeCaractere, nombreDeLigne);
}
